import 'dart:convert';

import 'package:client/common/conn.dart';
import 'package:client/common/event.dart';
import 'package:client/common/fun.dart';
import 'package:client/common/info_route.dart';
import 'package:client/provider/app_provider.dart';
import 'package:client/view/user/change_pwd.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class UserRoute extends StatelessWidget {
  const UserRoute({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // appBar: AppBar(
      //   title: Text("user"),
      // ),
      body: Container(
        padding: const EdgeInsets.only(top: 30),
        child: ListView(
          children: [
            // Text("user"),
            TextButton(
                onPressed: () {
                  Navigator.push(context, MaterialPageRoute(builder: (context) {
                    return const ChangePwdRoute();
                  }));
                },
                child: Text("修改密码")),
            TextButton(
                onPressed: () {
                  AppProvider.startTcp();
                },
                child: Text("重新连接")),
            TextButton(
                onPressed: () {
                  AppProvider.logOut();
                },
                child: Text("退出登录")),
          ],
        ),
      ),
    );
  }
}
